package cn.tedu.servlet.config;

import cn.tedu.servlet.DispatcherServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServletConfig {

    @Bean
    public ServletRegistrationBean<DispatcherServlet> myCustomServlet() {
        ServletRegistrationBean<DispatcherServlet> registrationBean = new ServletRegistrationBean<>(new DispatcherServlet());
        registrationBean.addUrlMappings("/dis/*");
        return registrationBean;
    }
}
